package com.lu.ssm.controller;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.lu.ssm.entity.User;
import com.lu.ssm.service.UserService;
import com.mysql.fabric.xmlrpc.base.Array;

@Controller
@RequestMapping("/user")
public class LoginController {

	@Autowired
	private UserService service;
	
	@RequestMapping("/login")
	public String login(HttpSession session){
//		List<User> lists=service.getList("111");
//		session.setAttribute("lists", lists);
		List<User> lists=new ArrayList<>();
		for(int i=0;i<4;i++){
			User user=new User();
			user.setEnable(i);
			user.setId(Long.valueOf(i));
			lists.add(user);
		}
		service.updateBatch(lists);
		session.setAttribute("lists", "ok");
		return "login";
	}
	
}
